package com.xcc.shopanim.mode;

import android.text.TextUtils;

import java.io.Serializable;

/**
 * ****************************************************
 * 作者 :: rookieCi<1056907550@qq.com>
 * ----------------------------------------------------
 * git :: https://gitee.com/rookieci
 * ----------------------------------------------------
 * 博客 :: http://blog.csdn.net/xcccicishuai
 * ----------------------------------------------------
 * 时间 :: 2019/7/4 Add by rookieCi
 * ----------------------------------------------------
 * 描述 :: ImageMode
 * ****************************************************
 */
public class ImageMode implements Serializable {
    public ImageMode() {
    }

    public ImageMode(String url) {
        this.url = url;
        isNet = true;
    }

    public ImageMode(String url, boolean isNet) {
        this.url = url;
        this.isNet = isNet;
    }

    public ImageMode(String key, String url) {
        this.key = key;
        this.url = url;
        isNet = true;
    }

    private String key;
    private String url;
    private boolean isNet;

    public void setUrl(String url) {
        this.url = url;
    }

    public void setNet(boolean net) {
        isNet = net;
    }

    public String getImgUrl() {
        return url;
    }

    public String getKey() {
        return key;
    }

    public boolean isNet() {
        return isNet;
    }

    public static boolean isEmpty(ImageMode mode) {
        return mode == null || (TextUtils.isEmpty(mode.url) && TextUtils.isEmpty(mode.key));
    }
}
